home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr47 / asmlib40.zip / SOURCE.DOC < prev    next >
Text File  |  1995-03-30  |  36KB  |  943 lines

  1. SOURCE.DOC Copyright (C) 1992 - 1995 Douglas Herr ■ all rights reserved
  2.  
  3.  
  4. RE-ASSEMBLING or MODIFYING ASMLIB LIBRARIES
  5.  
  6. Several INCLUDE files are in the ASMLIB source code archive which are
  7. used to define the code and data segments for the various memory models.
  8. For each memory model, you will need MODEL.INC to define the library
  9. segments, and a corresponding ASM.INC for the simplified segment definitions
  10. for your your main proegram.  There are several versions of MODEL.INC and
  11. ASM.INC in the ASMLIB source archive.  To use a particular memory model,
  12. for example the medium memory model, you should copy ASMM.INC to ASM.INC
  13. and copy MEDIUM.INC to MODEL.INC:
  14.  
  15.  
  16. LIBRARY MEMORY MODEL    LIBRARY INCLUDE FILE     MAIN PROGRAM INCLUDE FILE
  17.                          copy to MODEL.INC        copy to ASM.INC
  18.  
  19. TINY                     TINY.INC                 ASMT.INC
  20. asm86t.lib
  21. asm286t.lib
  22. evga86t.lib
  23. evga286t.lib
  24.  
  25.  
  26. SMALL                    SMALL.INC                ASMS.INC
  27. asm86s.lib
  28. asm286s.lib
  29. evga86s.lib
  30. evga286s.lib
  31.  
  32.  
  33. MEDIUM                   MEDIUM.INC               ASMM.INC
  34. asm86m.lib
  35. asm286m.lib
  36. evga86m.lib
  37. evga286m.lib
  38.  
  39.  
  40. HUGE                     HUGE.INC                 ASMH.INC
  41. asm86h.inc
  42. asm286h.inc
  43. evga86h.inc
  44. evga286h.inc
  45.  
  46.  
  47.  
  48. In general the properties of the memory models are:
  49.  
  50. TINY
  51.  
  52. Code, data and stack are all in the same segment; the total size
  53. of the segment may not exceed 64k.  All references to initialized data
  54. are near, all subroutine calls are near.  The program may use dynamic memory
  55. allocation and/or EMS or XMS memory for additional data space.  TINY model
  56. programs are linked with ASMLIB's TINY.ASM startup code and produce
  57. .COM-format programs.
  58.  
  59. To use the TINY memory mode, copy ASMT.INC to ASM.INC for your main program
  60. source code, and copy TINY.INC to MODEL.INC if you need to modify library
  61. source code.  LINK or TLINK using the /T switch; the TINY.OBJ object module
  62. must be the first object module linked.
  63.  
  64. ASMLIB libraries for the TINY model are:
  65.  
  66. asm86t.lib         general-purpose library, for 8088 or better computers
  67. asm286t.lib        general-purpose library, for 286 or better computers
  68. evga86t.lib        graphics library for 8088 or better computers, replaces
  69.                    ASMTINY graphics subroutines with subroutines for EGA
  70.                    or VGA 16-color graphics only.  Eliminates much of the
  71.                    code and data required for Hercules, CGA, 256-color and
  72.                    SVGA modes.
  73. evga286t.lib       graphics library for 286 or better computers, replaces
  74.                    286TINY graphics subroutines with subroutines for EGA
  75.                    or VGA 16-color graphics only.  Eliminates much of the
  76.                    code and data required for Hercules, CGA, 256-color and
  77.                    SVGA modes.
  78.  
  79.  
  80. SMALL
  81.  
  82. Code is in a single segment, which may not exceed 64k.  Initialized data
  83. and the stack are in a separate segment, which may not exceed 64k.  As
  84. with the TINY model, the program may use dynamic memory allocation and/or
  85. EMS or XMS memory for additional data space.  The small model assumes near
  86. subroutine calls.
  87.  
  88. To use the SMALL memory model, copy ASMS.INC to ASM.INC for your main program
  89. source code, and copy SMALL.INC to MODEL.INC for modifying library object
  90. modules.  SMALL model programs are linked with ASMLIB's STARTUP startup
  91. code; STARTUP.ASM is assembled after ASMS.INC is copied to ASM.INC.
  92.  
  93. ASMLIB libraries for the SMALL model are:
  94.  
  95. asm86s.lib         general-purpose library, for 8088 or better computers
  96. asm286s.lib        general-purpose library, for 286 or better computers
  97. evga86s.lib        graphics library for 8088 or better computers, replaces
  98.                    ASMSMALL graphics subroutines with subroutines for EGA
  99.                    or VGA 16-color graphics only.  Eliminates much of the
  100.                    code and data required for Hercules, CGA, 256-color and
  101.                    SVGA modes.
  102. evga286s.lib       graphics library for 286 or better computers, replaces
  103.                    286SMALL graphics subroutines with subroutines for EGA
  104.                    or VGA 16-color graphics only.  Eliminates much of the
  105.                    code and data required for Hercules, CGA, 256-color and
  106.                    SVGA modes.
  107.  
  108.  
  109. MEDIUM
  110.  
  111. Code may be in more than one segment, each of which may not exceed 64k.
  112. Initialized data and the stack are in a separate segment, which may not
  113. exceed 64k.  As with the TINY and SMALL models, the program may use dynamic
  114. memory allocation and/or EMS or XMS memory for additional data space.  The
  115. medium model assumes far subroutine calls between code segments.
  116.  
  117. To use the MEDIUM memory model, copy ASMM.INC to ASM.INC for your main program
  118. source code and for STARTUP.ASM, and copy MEDIUM.INC to MODEL.INC for
  119. modifying library object modules.  MEDIUM model programs are linked with
  120. ASMLIB's STARTUP startup code; STARTUP.ASM is assembled after ASMM.INC is
  121. copied to ASM.INC.
  122.  
  123. ASMLIB libraries for the MEDIUM model are:
  124.  
  125. asm86m.lib         general-purpose library, for 8088 or better computers
  126. asm286m.lib        general-purpose library, for 286 or better computers
  127. evga86m.lib        graphics library for 8088 or better computers, replaces
  128.                    ASMLIB graphics subroutines with subroutines for EGA
  129.                    or VGA 16-color graphics only.  Eliminates much of the
  130.                    code and data required for Hercules, CGA, 256-color and
  131.                    SVGA modes.
  132. evga286m.lib       graphics library for 286 or better computers, replaces
  133.                    286LIB graphics subroutines with subroutines for EGA
  134.                    or VGA 16-color graphics only.  Eliminates much of the
  135.                    code and data required for Hercules, CGA, 256-color and
  136.                    SVGA modes.
  137.  
  138.  
  139. HUGE
  140.  
  141. ASMLIB's definition of a HUGE memory model does not strictly adhere
  142. to the standard definition, which says that the program should not assume
  143. that DS is pointed to any particular data segment.  ASMLIB's HUGE model
  144. libraries assume DS:DGROUP, SS:DGROUP.  Code may be in more than one
  145. segment, each of which may not exceed 64k.  Initialized data and the stack
  146. are in a separate segment, which may not exceed 64k.  Dynamic memory
  147. allocation, EMS or XMS memory and additional data segments may be used for
  148. additional data space.  The huge model assumes far subroutine calls between
  149. code segments.  The primary difference between ASMLIB's MEDIUM and HUGE
  150. model libraries is that the HUGE model libraries allow seamless access to
  151. data blocks greater than 64k.  Data blocks over 64k bytes are typically
  152. dynamically allocated to store large bit blocks from high-resolution
  153. graphics screens or may be loaded from a disk file.
  154.  
  155. To use the HUGE memory model, copy ASMH.INC to ASM.INC for your main program
  156. source code and for STARTUP.ASM, and copy HUGE.INC to MODEL.INC for
  157. modifying library object modules.  HUGE model programs are linked with
  158. ASMLIB's STARTUP startup code; STARTUP.ASM is assembled after ASMH.INC is
  159. copied to ASM.INC.
  160.  
  161. ASMLIB libraries for the HUGE model are:
  162.  
  163. asm86h.lib         general-purpose library, for 8088 or better computers
  164. asm286h.lib        general-purpose library, for 286 or better computers
  165. evga86h.lib        graphics library for 8088 or better computers, replaces
  166.                    ASMHUGE graphics subroutines with subroutines for EGA
  167.                    or VGA 16-color graphics only.  Eliminates much of the
  168.                    code and data required for Hercules, CGA, 256-color and
  169.                    SVGA modes.
  170. evga286h.lib       graphics library for 286 or better computers, replaces
  171.                    286HUGE graphics subroutines with subroutines for EGA
  172.                    or VGA 16-color graphics only.  Eliminates much of the
  173.                    code and data required for Hercules, CGA, 256-color and
  174.                    SVGA modes.
  175.  
  176.  
  177. You should use the "smallest" memory model your program allows; if your
  178. program's code + initialized data is less than 64k, you will probably get
  179. the smallest and fastest program using the TINY model.  If your program
  180. requires more code or data space than the TINY model allows, use the SMALL
  181. model.  The MEDIUM model works well for programs with code > 64k, but
  182. should be avoided for smaller programs because the FAR calls used between
  183. code segments are slower and consume more bytes than the NEAR calls in
  184. the SMALL and TINY models.  The HUGE model should be used only where you
  185. need to use continuous data blocks greater than 64k, because the code
  186. required to span 64k segment boundaries adds extra bytes to the program
  187. and slows its operation somewhat.
  188.  
  189. The EGA/VGA 16-color graphics libraries (EVGA*.LIB) are used in
  190. conjunction with the general purpose libraies.  The EGA/VGA libraries
  191. contain subroutines which replace the general-purpose graphics mode
  192. subroutines in the general-purpose libraries, but do not include the
  193. full ASMLIB library.
  194. To make LINK or TLINK use the EGA/VGA-specific subroutines, link your
  195. program specifying the EVGA library before the general-purpose library.
  196. This example links ASMLIB's tiny.obj startup code with your program.obj
  197. object module, using EGA or VGA 16-color graphics only, and a 286 or
  198. better computer:
  199.  
  200. LINK /T tiny+program,program,,evga286t+asm286t;
  201.  
  202.  
  203. To assemble library source code for 286 or better computers, use the
  204. MASM/TASM /D switch, which allows you to define assembly conditions.
  205. This example assembles DRAWLINE.ASM for 286 or better computers:
  206.  
  207. MASM /DNOXT drawline;
  208.  
  209. You may use multiple /D switches when assembling ASMLIB source code.
  210. This example assembles GPRINT.ASM for 286 or better computers using
  211. EGA or VGA 16-color graphics only:
  212.  
  213. MASM /DNOXT /DEVGA gprint;
  214.  
  215. You can replace an object module in any of the ASMLIB libraries using
  216. MASM's LIB or TASM's TLIB utility program.  Let's say I've modified
  217. GPRINT.ASM and I want to update the ASM86M.LIB library with the new
  218. GPRINT object module:
  219.  
  220. MASM gprint;
  221. LIB ASM86M -+gprint;
  222.  
  223.  
  224. ASMLIB includes a number of subroutines which are not applicable to general
  225. programming.  These subroutines include "$" in their names.  All "$"
  226. subroutines require a near call, so the calling program must be in the same
  227. segment as the called subroutine.  The segment names used by ASMLIB are:
  228.  
  229. tiny:     _TEXT   (assumes CS:DGROUP,  DS:DGROUP)
  230. small:    _TEXT   (assumes CS:_TEXT,   DS:DGROUP)
  231. medium:   _MEDIUM (assumes CS:_MEDIUM, DS:DGROUP)
  232. huge:     _HUGE   (assumes CS:_HUGE,   DS:DGROUP)
  233.  
  234. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  235.  
  236. $banks.asm:   SVGA bank-switching code
  237.  
  238.  
  239. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  240.  
  241. $clip:        clip a line to fit within graphics view area
  242. Source:       $clip.asm ($graph.asm)
  243.  
  244. Call with:    call from ASMLIB line drawing subroutines
  245.               assumes DS:@data
  246. Returns:      x & y coordinates in DRAWLINE data area within view area
  247. Uses:         AX, BX, CX, DX, DI, flags
  248.  
  249.  
  250. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  251.  
  252. $circle:      calculates circle aspect ratio and circumferance
  253. Source:       $circle ($graph.asm)
  254.  
  255. Used by:      DrawCircle; don't try using this subroutine without
  256.               in-depth knowledge of $circle and DrawCircle
  257.  
  258.  
  259. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  260.  
  261. $ega16:       update EGA/VGA/SVGA registers for given drawmode & color
  262. Source:       $ega16.asm ($graph.asm)
  263.  
  264. Call with:    no parameters
  265.               call $graph before calling $ega16
  266.               drawmode & gcolor must be current
  267. Returns:      DX = 3CEh (Graphics Controller data register address)
  268. Uses:         DX, flags
  269.  
  270.  
  271. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  272.  
  273. $emspage:     position logical EMS page at page 0 of page frame
  274. source:       $emspage.asm
  275.  
  276. Call with:    DS:[BX] pointing to 4-byte offset into allocated EMS block
  277.               DX = EMS handle
  278. Returns:      if CF = 0, no error; AL = logical page
  279.               if CF = 1, AH = error code
  280. Uses:         AX, flags
  281.  
  282. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  283.  
  284. $enter:       entry code for ASMLIB graphics subroutines which saves
  285.               registers and sets up ASMLIB for the graphics mode in use
  286. Source:       $enter.asm ($graph.asm)
  287.  
  288. Call with:    no parameters
  289. Returns:      calls $graph
  290.               pushes flags, BX, CX, DX, DI, SI, ES, BP
  291.               BP = SP
  292.               DF = 0
  293. Uses:         AX, SP, DF
  294.  
  295.  
  296. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  297.  
  298. $exit:        exit code for ASMLIB graphics subroutines
  299. Source:       $exit.asm
  300.  
  301. Call with:    BP = stack frame pointer
  302.               AX, flags, BX, CX, DX, DI, SI, ES, BP pushed on stack
  303. Returns:      returns to program calling the primary subroutine
  304. Uses:         flags, all registers except DS
  305.  
  306.  
  307. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  308.  
  309. $fget:        read more data into file buffer; used by ASMLIB buffered file
  310.               input subroutines
  311. Source:       $fget.asm
  312.  
  313. Call with:    BX = file handle
  314.               ES = buffer segment address
  315. Returns:      DF = 0
  316.               if CF = 0, AX = bytes read from file
  317.               if CF = 1, AX = DOS error code
  318. Uses:         AX, DX, SI, DS, flags
  319.  
  320. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  321.  
  322. $gbytes:      calculate byte size of graphics screen
  323. Source:       $gbytes.asm ($graph.asm)
  324.  
  325. Call with:    no parameters
  326.               $graph must have been called while in the current
  327.               graphics mode before calling $gbytes
  328.  
  329. Returns:      DX:AX = byte size of screen
  330. Uses:         AX, DX
  331.  
  332.  
  333. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  334.  
  335. $getdot:      determines pixel status (graphics modes)
  336. Source:       $getdot.asm ($graph.asm)
  337.  
  338. Call with:    AX = x-coordinate, BX = y-coordinate
  339.               ES = segment address of screen buffer
  340.               $graph must have been called while in the current
  341.               graphics mode before calling $getdot
  342.  
  343. Returns:      AX = pixel value
  344. Uses:         AX, flags
  345.  
  346.  
  347. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  348.  
  349. $gp00, $gp02, $gp06, $gp08, $gp10: GPrint/GPrintX code for various dottypes
  350. Source:       $gp00.asm, $gp02.asm, $gp06.asm $gp08.asm, $gp10.asm
  351.                    (banks.asm, $ytable.asm)
  352.  
  353. Call with:    called from GPrint or GPrintX subroutines
  354.               DS:[SI] -> character font definition
  355.               ES = segment address of screen buffer
  356. Returns:      nothing
  357.               prints a character on graphics screen
  358. Uses:         AX, BX, CX, DX, DI, SI, flags
  359.  
  360.  
  361. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  362.  
  363. $gpick:      select string from fixed-field string block; graph mode
  364. Source:      $gpick.asm (heap.asm, strncpy.asm, drawbox.asm, fillbox.asm,
  365.                gprint.asm, allocdos.asm, bitblock.asm, bbbytes.asm,
  366.                strlen.asm, gcolor.asm, a$menu.asm, $graph.asm, m$input.asm,
  367.                v$extkey.asm, m$chrn.asm, m$nkey.asm)
  368.  
  369. Call with:   ES = segment address of string list
  370.              AX = number of strings
  371.              CX = field size
  372.              BX = initial choice
  373.              DS:[DX] pointing to upper left screen coordinates
  374.              assumes DS:DGROUP
  375. Returns:     AX = returning keycode
  376.              BX = returned selection number
  377. Uses:        AX, BX, CX, DX, SI, DI, flags
  378.  
  379.  
  380. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  381.  
  382. $graph:       set up screen parameters for all ASMLIB graphics modes
  383. Source:       $graph.asm (gcolor.asm, $ytable.asm)
  384.  
  385. Call with:    no parameters
  386.               system must be in graphics mode you intend to use
  387. Returns:      nothing
  388.               updates $graph data: view coordinates
  389.                                    x-limit
  390.                                    y-limit
  391.                                    base segment address
  392.                                    page size
  393.                                    byte width of screen
  394.                                    maximum page number
  395.                                    dot type:  0 = CGA 4-color
  396.                                               2 = monochrome
  397.                                                   (CGA, Herc, ATT, mode 11h)
  398.                                               4 = Hercules InColor
  399.                                               6 = EGA/VGA 16-color & monochrome
  400.                                                   SVGA16 (up to 800x600)
  401.                                               8 = mode 13h 256-color
  402.                                              10 = VGA13X
  403.                                              12 = SVGA16 (over 800x600)
  404.                                              14 = SVGA256
  405.  
  406.  
  407. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  408.  
  409. $h8x8:       copies standard 8x8 character definition to 0B400:0000
  410.              for Hercules RamFont modes
  411. Source:      $h8x8.asm (f8x8.asm)
  412.  
  413. Call with:   no parameters; assumes Hercules RamFont card is installed
  414. Returns:     nothing
  415. Uses:        nothing; all registers and flags are saved
  416. Used by:     HRam9043, HRam8043
  417.  
  418.  
  419. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  420.  
  421. $h8x12:      copies standard 8x12 character definition to 0B400:0000
  422.              for Hercules RamFont modes
  423. Source:      $h8x12.asm ($rld.asm, f8x12rle.asm)
  424.  
  425. Call with:   no parameters; assumes Hercules RamFont card is installed
  426. Returns:     nothing
  427. Uses:        nothing; all registers and flags are saved
  428. Used by:     HRam9029, HRam8029
  429.  
  430.  
  431. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  432.  
  433. $handle:     verify handle for buffered file I/O
  434. Source:      fopen.asm
  435.  
  436. Call with:   BX = file handle
  437.              ASSUMES DS:DGROUP
  438. Returns:     if CF = 0, SI points to file handle in ASMLIB buffer data area
  439.                         segment address of buffer associated with this handle
  440.                         at 2[SI]
  441.              if CF = 1, handle in BX not managed by ASMLIB buffer system
  442. Uses:        SI, flags
  443.  
  444. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  445.  
  446. $herc:       detects Hercules-compatible equipment; does not determine
  447.              if Hercules equipment is the default monitor (see IsHerc)
  448. Source:      $herc.asm
  449.  
  450. Call with:   no parameters
  451.              Assumes DS:@data
  452. Returns:     if CF = 1, no Hercules-compatible equipment installed
  453.              if CF = 0, AX = Hercules model
  454.                        128 = Hercules Graphics Card or compatible
  455.                        144 = Hercules Graphics Card Plus
  456.                        208 = Hercules InColor card
  457. Uses:        AX, flags
  458.  
  459.  
  460. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  461.  
  462. $herc16:      update InColor registers for given drawmode & color
  463.               used only by dottype 4 in graphics modes
  464. Source:       $herc16.asm ($graph.asm)
  465.  
  466. Call with:    no parameters
  467.               call $graph before calling $herc16
  468.               drawmode & gcolor must be current
  469. Returns:      BX = ABS(drawmode) shl 1
  470. Uses:         BX, flags
  471.  
  472.  
  473. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  474.  
  475. $hislope:     draw a high-slope line
  476. Source:       $hislope.asm ($ega16.asm, $herc16.asm, $vga256.asm,
  477.                           $hipatrn.asm, banks.asm, $graph.asm, dotmask.asm)
  478.  
  479. Call with:    DS:@data
  480.               ES = screen buffer segment
  481.               x0 = [BP-2]
  482.               y0 = [BP-4]
  483.               x1 = [BP-6]
  484.               y1 = [BP-8]
  485. Returns:      nothing
  486. Uses:         AX, BX, CX, DX, DI, SI, flags
  487.  
  488.  
  489. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  490.  
  491. $horiz:       draw horizontal line
  492. Source:       $horiz.asm ($ega16.asm, $herc16.asm, $vga256.asm, $hvpatrn.asm
  493.                           banks.asm, $graph.asm, dotmask.asm)
  494.  
  495. Call with:    DS:@data
  496.               ES = screen buffer segment
  497.               x0 = [BP-2]
  498.               y0 = [BP-4]
  499.               x1 = [BP-6]
  500.               y1 = [BP-8]
  501. Returns:      nothing
  502. Uses:         AX, BX, CX, DX, DI, SI, flags
  503.  
  504.  
  505. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  506.  
  507. $hipatrn:     draw a high-slope line with pattern
  508.               called from $hislope
  509. Source:       $hipatrn.asm
  510.  
  511. $hpattern:    draw a horizontal line with pattern
  512.               called from $horiz
  513. Source:       $hvpatrn.asm
  514.  
  515. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  516.  
  517. a$putw:      module used by several ASMLIB text subroutines to copy
  518.              a character/attribute pair to a window of the screen;
  519.              includes snow control logic for CGA systems.
  520. Source:      a$putw.asm
  521.  
  522. Call with:   CX = column width of window
  523.              DX = 0 to disable snow control
  524.                 = 3DAh to enable snow control (COLOR monitors only!!)
  525.              SI = row height of window
  526.              ES:[DI] points to video buffer
  527.              AL = character
  528.              AH = color attribute
  529.              BX = bytes per screen row (80-column screen has 160 bytes per row)
  530.              DF = 0 (clear direction flag with CLD)
  531. Uses:        DI, SI, flags
  532.  
  533.  
  534. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  535.  
  536. $paint:      used to change color of the screen; used by Paint and
  537.              WPaint subroutines.  Includes snow control logic for CGA
  538.              systems.
  539. Source:      $paint.asm
  540.  
  541. Call with:   ES:[DI] pointing to screen
  542.              CX = number of columns
  543.              SI = number of rows
  544.              AH = color attribute
  545.              DX = 3DAh for CGA snow control, 0 otherwise
  546.              BP = bytes per screen row
  547.  
  548. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  549.  
  550. $plane:      set up graphics plane for read or write
  551. Source:      $plane.asm
  552.  
  553. Call with:   AL = plane number
  554. Returns:     nothing
  555. Supports:    EGA & VGA 16-color modes
  556.              EGA monochrome
  557.              VGA13X
  558.              Hercules InColor
  559.  
  560.  
  561. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  562.  
  563. $recolor:    replaces selected screen color; used by ReColor and
  564.              WReColor subroutines.  Includes snow control logic for CGA
  565.              systems.
  566. Source:      $recolor.asm
  567.  
  568. Call with:   ES:[DI] pointing to screen
  569.              AL = oldcolor
  570.              AH = newcolor
  571.              DX = 0 or 3DAh for snow control
  572.              SI = number of rows
  573.              CX = number of columns
  574.              BP = bytes per screen row
  575.  
  576.  
  577. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  578.  
  579. a$wdata:     parameter manager for ASMLIB's Window subroutines.
  580. Source:      a$wdata.asm (crtinfo.asm)
  581.  
  582. Call with:   DS:[BX] pointing to widow corner data
  583.              requires 2 bytes available at [bp-2]
  584.              row0  equ  [bx]
  585.              col0  equ 2[bx]
  586.              row1  equ 4[bx]
  587.              col1  equ 6[bx]
  588. Returns:     SI = number of rows
  589.              CX = number of columns
  590.              DX = 0 if no CGA, 3DAh if CGA and "snow" control not disabled
  591.              [bp-2] = bytes per screen row
  592.              ES:[DI] -> [row0, col0] on screen
  593. Uses:        CX, DX, DI, SI, ES, [BP-2], flags
  594.  
  595.  
  596. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  597.  
  598. $rlbytes:    calculates bytes required to decode run-length encoded data
  599. Source:      $rlbytes.asm
  600.  
  601. Call with:   DS:[SI] pointing to encoded data
  602.              CX = size of encoded data block
  603. Returns:     AX = bytes required to decode data block
  604. Uses:        AX
  605.  
  606. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  607.  
  608. $rld:        decodes run-length encoded data
  609. Source:      $rld.asm
  610.  
  611. Call with:   DS:[SI] pointing to encoded source data
  612.              ES:[DI] pointing to destination buffer
  613.              CX = number of encoded bytes
  614.              assumes destination buffer is large enough for decoded data
  615. Returns:     nothing
  616. Uses:        nothing
  617.  
  618.  
  619. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  620.  
  621. $rle:        run-length encoding data compression
  622. Source:      $rle.asm
  623.  
  624. Call with:   DS:[SI] pointing to data to be encoded
  625.              ES:[DI] pointing to output buffer
  626.              CX = number of bytes to encode
  627.              assumes output buffer is at least the same size as input data
  628. Returns:     DF = 0
  629.              if CF = 0, AX = encoded data size
  630.              if CF = 1, run-length encoding will not compress file
  631.                         data in output buffer is incomplete
  632. Uses:        AX, flags
  633.  
  634. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  635.  
  636. $strstr:     string search module used by several ASMLIB subroutines
  637. Source:      $strstr.asm
  638.  
  639. Call with:   ES:[DI] -> search string, DS:[SI] -> pattern string
  640.              BX = pattern string length, DX = search string length
  641.              $strstr searches for the first occurrance of the pattern
  642.              string in the search string
  643. Returns:     if CF = 1, no match
  644.              if CF = 0, AX = match offset from ES:[DI]
  645. Uses:        AX, BX, CX, DX, SI, DI, flags
  646.  
  647.  
  648. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  649.  
  650. $wcopy:      copies word data from one portion of memory to another;
  651.              intended for copying to/from video memory in text mode
  652.              includes snow control logic for CGA systems.
  653. Source:      $wcopy.asm
  654.  
  655. Call with:   CX = words to copy
  656.              DS:[SI] -> source
  657.              ES:[DI] -> destination
  658.              DX = CRTC status port if CGA, else 0
  659.              DF = 0 or 1
  660. Returns:     ES:[DI] pointing past end of destination
  661.              DS:[SI] pointing past end of block
  662.              CX = 0
  663. Uses:        AX, CX, DI, SI, flags
  664. Called by:   WSave, WRestore, GetScreen, PutScreen, TCopy, VScroll, HScroll
  665.  
  666. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  667.  
  668. $strlist:     copy group of ASCIIZ strings to block of fixed-length strings
  669. source:       $strlist.asm (allocdos.asm, strlen.asm, m$count.asm)
  670.  
  671. Call with:    DS:[SI] pointing to first string to copy
  672.               CX = minimum field size
  673.               string group terminated with double NUL
  674.               requires sufficient free DOS memory
  675.  
  676. Returns:      if CF = 1, insufficient DOS memory available
  677.               if CF = 0:
  678.                ES = base segment address of string block
  679.                AX = number of strings
  680.                CX = string field size
  681. Uses:         AX, CX, ES, flags
  682. Called by:    PICKSTR, GPICKSTR
  683.  
  684.  
  685. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  686.  
  687. m$count:      counts a group of ASCIIZ strings
  688. Source:       m$count.asm (strlen.asm)
  689.  
  690. Call with:    DS:[BX] pointing to first string
  691.               string group terminated with double NUL
  692. Returns:      AX = number of strings
  693.               CX = length of longest string in group
  694. Uses:         AX, BX, CX, flags
  695. Called by:    PICKSTR, PULLDOWN
  696.  
  697.  
  698.  
  699. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  700.  
  701. m$nkey:       process normal keystroke for menu subroutines
  702. Source:       m$nkey.asm (isupper.asm, m$chr.asm)
  703.  
  704. Call with:    AL = key code
  705.               BX = initial cursor position
  706.               CX = field width
  707.               DX = number of menu choices
  708.               ES:[DI] pointing to first menu choice
  709. Returns:      BX = output position
  710.                if CF = 0, found matching character
  711.                if CF = 1, no match
  712. Uses:         AX, BX, CX, DX, DI, flags
  713. Called by:    $pick
  714.  
  715.  
  716. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  717.  
  718. m$chr:        determines if a keycode is the first uppercase character
  719.               in a string
  720. Source:       m$chr.asm (strlen.asm)
  721.  
  722. Call with:    AX = keycode
  723.               DS:[BX] pointing to string
  724. Returns:      if CF = 1, string length = 0
  725.               if CF = 0:
  726.                 CX = 0 if no upper case characters in the string
  727.                 if CX <> 0, AH = first UCASE character
  728.                 ZF = 1 if character is first ucase in string
  729.                 DS:[BX] points to first ucase character
  730. Uses:         AX, BX, CX, flags
  731. Called by:    $pick, PULLDOWN
  732.  
  733.  
  734. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  735.  
  736. $listwindow:  calculates window dimensions for input list; adjusts
  737.               upper left corner coordinates if required to fit on screen
  738. Source:       $pick.asm (crtinfo.asm)
  739.  
  740. Call with:    DS:[BX] pointing to 8-byte data area for window corner data
  741.               AX = number of choices in list
  742.               CX = list field width
  743.               DH = desired first screen row for list
  744.               DL = desired first column for list
  745.               $listwindow assumes that DH < total screen rows
  746. Returns:      DH = adjusted first row for $pick
  747.               DL = adjusted first column for $pick
  748.               8 bytes at DS:[BX] are updated with window corner coordinates
  749.               for WSave, WFrame, WRestore, etc.
  750. Uses:         DX; all other registers and flags are saved
  751. Called by:    PICKSTR, PICKFILE
  752.  
  753.  
  754. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  755.  
  756. $pick:        select one string from a list of fixed-length strings
  757.               used in text-mode menu subroutines
  758. Source:       $pick.asm (crtinfo.asm, str2vbuf.asm, a$putw.asm, m$input.asm,
  759.                          m$chr.asm, m$nkey.asm, a$menu.asm, v$extkey.asm)
  760.  
  761. Call with:    ES:[DI] pointing to list of choices
  762.               AX = number of menu choices
  763.               CX = field width
  764.               BX = initial cursor position
  765.               DH = top screen row
  766.               DL = left screen column
  767.               Returns to calling program when Esc, Enter or ^C pressed
  768.  
  769. Returns:      if BreakTrap enabled:
  770.                if CF = 1, ^C or ^Break was pressed
  771.               AX = last key pressed (AX = 3 if ^C pressed)
  772.               BX = string number selected (first string = 0)
  773. Uses:         AX, BX, CF
  774. Called by:    PICKSTR, PICKF
  775.  
  776. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  777.  
  778. v$extkey:     extended keycode processor for ASMLIB vertical list menus
  779.               (text and graph modes)
  780. Source:       v$extkey.asm
  781.  
  782. Call with:    AL = low word of ASMLIB extended key code
  783.               [bp-2] = field width of string list
  784.               [bp-4] = number of choices
  785.               [bp-6] = current choice
  786.               [bp-8] = first string to print (for scrolling if required)
  787.               [bp-10] = number of strings to print 
  788.                         ( = number of choices if no scrolling required)
  789.  
  790. Returns:      if CF = 0, modifies [bp-6] and [bp-8]
  791.               if CF = 1, keycode not a valid cursor movement key
  792.               valid keys: Up, Down, Home, End, PgUp, PgDown
  793.  
  794. Uses:         AX, flags
  795. Called by:    $pick, $gpick
  796.  
  797. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  798.  
  799. FIND_CGA:     determine if color monitor is installed
  800. FIND_MDA:     determine if monochrome monitor is installed
  801. Source:       $6845.asm
  802.  
  803. Call with:    no parameters
  804. Returns:      if CF = 0, monitor is installed
  805.               if CF = 1, monitor is not installed
  806. Uses:         flags
  807.  
  808.  
  809.  
  810. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  811.  
  812. $ytable:      calculate buffer offset for each row of screen
  813.               used to set up for dottype 0 - 4 graphics modes
  814. Source:       $ytable.asm ($herc.asm)
  815.  
  816. Call with:    AX = 0
  817.               ES:[DI] pointing to YTABLE data area
  818.               CX = ylimit+1
  819.               DF = 0
  820. Returns:      nothing
  821. Uses:         AX, BX, CX, DX, DI
  822.  
  823.  
  824.  
  825. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  826.  
  827. a$mname:      return month or day name to calling program
  828.               used by MONTHNAME and DAYNAME
  829. Source:       a$mname.asm
  830.  
  831. Returns:      ES:[BX] -> month name string
  832.               CX = string length
  833. Uses:         ES, BX, CX
  834.  
  835.  
  836. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  837.  
  838. $vga256:      determine color & machine code for given drawmode
  839. Source:       $vga256.asm ($graph.asm)
  840.  
  841. Call with:    no parameters
  842.               call $graph before calling $vga256
  843.               drawmode & gcolor must be current
  844. Returns:      AL = color
  845.               DL = machine code
  846.               DH = ABS(drawmode)
  847. Uses:         AX, DX, flags
  848.  
  849.  
  850.  
  851. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  852.  
  853. $reset:       restores default hardware settings for graphics modes
  854.               used as part of exit code from ASMLIB graphics subroutines
  855. Source:       $reset.asm ($graph.asm)
  856.  
  857. Call with:    no parameters
  858. Returns:      nothing
  859. Uses:         nothing
  860.  
  861.  
  862. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  863.  
  864. $putdot:      updates a pixel on graphics screen
  865. Source:       $putdot.asm ($graph.asm, $herc16.asm, banks.asm, dotmask.asm)
  866.  
  867. Call with:    AX = x-coordinate, BX = y-coordinate
  868.               ES = segment address of screen buffer
  869.               all $graph data must be current
  870. Returns:      nothing
  871. Uses:         flags
  872.  
  873.  
  874.  
  875. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  876.  
  877. $rotate:      rotates character font for GPrint & GPrintX
  878. Source:       $gp.asm
  879.  
  880. Call with:    DS:[SI] pointing to unrotated font
  881. Returns:      DS:[SI] pointing to new charcter font on stack
  882.               DS:@data
  883. Uses:         DS, SI, flags
  884.  
  885.  
  886.  
  887. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  888.  
  889. $vert:        draw vertical line
  890. Source:       $vert.asm ($ega16.asm, $herc16.asm, $vga256.asm, $hvpatrn.asm
  891.                           banks.asm, $graph.asm, dotmask.asm)
  892.  
  893. Call with:    DS:@data
  894.               ES = screen buffer segment
  895.               x0 = [BP-2]
  896.               y0 = [BP-4]
  897.               x1 = [BP-6]
  898.               y1 = [BP-8]
  899. Returns:      nothing
  900. Uses:         AX, BX, CX, DX, DI, SI, flags
  901.  
  902.  
  903. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  904.  
  905. $loslope:     draw a low-slope line
  906. Source:       $loslope.asm ($ega16.asm, $herc16.asm, $vga256.asm,
  907.                           $lopatrn.asm, banks.asm, $graph.asm, dotmask.asm)
  908.  
  909. Call with:    DS:@data
  910.               ES = screen buffer segment
  911.               x0 = [BP-2]
  912.               y0 = [BP-4]
  913.               x1 = [BP-6]
  914.               y1 = [BP-8]
  915. Returns:      nothing
  916. Uses:         AX, BX, CX, DX, DI, SI, flags
  917.  
  918.  
  919.  
  920. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  921.  
  922. m$input:      input module for ASMLIB menu subroutines
  923. Source:       m$input.asm (kifwait.asm, $flags.asm)
  924.  
  925. Call with:    DS:@data
  926. Returns:      AX = keycode
  927.               BX = mouse buttons pressed
  928.                mouse motion is returned as a Left, Right, Up or Down
  929.                keycode.  IsMouse must be called before the menu subroutine
  930.                to enable mouse functions.
  931. Uses:         AX, BX, flags
  932.  
  933.  
  934. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  935.  
  936. $lopatrn:     draw a low-slope line with pattern
  937.               called from $loslope
  938. Source:       $lopatrn.asm
  939.  
  940. $vpattern:    draw a vertical line with pattern
  941.               called from $vert
  942. Source:       $hvpatrn.asm
  943.